package com.training.java.core.exceptions;

//This class has transfer which take tranfer ammount as parameter.

public class TransferService {

	private double checkingAccountBalance = 10000;
	private double savingsAccountBalance = 10000;

	public void transfer(double howMuch) throws InSufficiantBalanceException {
		if (howMuch > checkingAccountBalance) {
			throw new InSufficiantBalanceException(
					"You don't have  sufficient balance in your checkingA/C");
		} else {
			checkingAccountBalance -= howMuch;
			savingsAccountBalance += howMuch;
		}

		// Getter Methods

	}

	public double getCheckingAccountBalance() {
		return checkingAccountBalance;
	}

	public double getSavingsAccountBalance() {
		return savingsAccountBalance;
	}

}
